package cn.rdq.iknessplatform.config;

import cn.rdq.common.constant.RedisConst;
import cn.rdq.common.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class SettingInitConfig implements ApplicationListener<ApplicationReadyEvent> {

    @Autowired
    private RedisUtil redisUtil;

    @Override
    public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
        redisUtil.set(RedisConst.ONLINE_KEY, 0);
    }
}
